#!/bin/bash

while true; do
  server=`ps aux | grep "python main.py" | grep -v grep | wc -l`
  if [ $server -lt 1 ]; then
    nohup python main.py 2>/dev/null 1>&2 &
    echo "server start"
  fi
  sleep 5
done
